import React from 'react'
import {Link} from 'react-router-dom'
import {TabBar} from 'antd-mobile'
import InvestOnline from '../../pages/investOnline/index'
import './index.less'
import Mine from '../../pages/mine'
import Equity from '../../pages/equity';
import Insurance from '../../pages/insurance';
import PropTypes from 'prop-types';
export default class Footer extends React.Component{
  static contextTypes = {
    router: PropTypes.object
}
  constructor(props) {
    super(props);
    console.log('接收到的参数：',this.props.selectTab);
    this.state={
      selectedTab:this.props.selectTab
    }
  } 
  handleClickToEquity=()=>{
    this.context.router.history.push('/equity');
  }
    render(){
        return(
            <div>
              <TabBar
                unselectedTintColor="#949494"
                tintColor="#33A3F4"
                barTintColor="white"
                noRenderContent 
              >
                <TabBar.Item
                  title="首页"
                  key="index"
                  icon={<div style={{
                    width: '22px',
                    height: '22px',
                    background: 'url(https://zos.alipayobjects.com/rmsportal/sifuoDUQdAFKAVcFGROC.svg) center center /  21px 21px no-repeat' }}
                  />
                  }
                  selectedIcon={<div style={{
                    width: '22px',
                    height: '22px',
                    background: 'url(https://zos.alipayobjects.com/rmsportal/iSrlOTqrKddqbOmlvUfq.svg) center center /  21px 21px no-repeat' }}
                  />
                  }
                  selected={this.state.selectedTab === 'index'}
                  onPress={() => {
                    this.context.router.history.push('/');
                  }}
                  data-seed="logId"
                >
                {/* <InvestOnline/> */}
                </TabBar.Item>
                <TabBar.Item
                  icon={
                    <div style={{
                      width: '22px',
                      height: '22px',
                      background: 'url(https://gw.alipayobjects.com/zos/rmsportal/BTSsmHkPsQSPTktcXyTV.svg) center center /  21px 21px no-repeat' }}
                    />
                  }
                  selectedIcon={
                    <div style={{
                      width: '22px',
                      height: '22px',
                      background: 'url(https://gw.alipayobjects.com/zos/rmsportal/ekLecvKBnRazVLXbWOnE.svg) center center /  21px 21px no-repeat' }}
                    />
                  }
                  title="保险"
                  key="insurance"
                  selected={this.state.selectedTab === 'insurance'}
                  onPress={() => {
                    this.context.router.history.push('/insurance');
                  }}
                  data-seed="logId1"
                >
                
                {/* <Insurance/> */}
                </TabBar.Item>
                <TabBar.Item
                  icon={
                    <div style={{
                      width: '22px',
                      height: '22px',
                      background: 'url(https://zos.alipayobjects.com/rmsportal/psUFoAMjkCcjqtUCNPxB.svg) center center /  21px 21px no-repeat' }}
                    />
                  }
                  selectedIcon={
                    <div style={{
                      width: '22px',
                      height: '22px',
                      background: 'url(https://zos.alipayobjects.com/rmsportal/IIRLrXXrFAhXVdhMWgUI.svg) center center /  21px 21px no-repeat' }}
                    />
                  }
                  title="权益"
                  key="equity"
                  dot
                  selected={this.state.selectedTab === 'equity'}
                  onPress={this.handleClickToEquity}
                >
                 
                 {/* <Equity/> */}
                </TabBar.Item>
                <TabBar.Item
                  icon={{ uri: 'https://zos.alipayobjects.com/rmsportal/asJMfBrNqpMMlVpeInPQ.svg' }}
                  selectedIcon={{ uri: 'https://zos.alipayobjects.com/rmsportal/gjpzzcrPMkhfEqgbYvmN.svg' }}
                  title="我的"
                  key="mine"
                  selected={this.state.selectedTab === 'mine'}
                  onPress={() => {
                    this.context.router.history.push('/mine');
                  }}
                >
                 {/* <Mine/> */}
                </TabBar.Item>
            </TabBar>
              
          </div>
        );
    }
}